package com.analyst.dto.ui;

import cn.hutool.json.JSONObject;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * ClassName: NodeUI
 * Package: com.analyst.entity.ui
 * Description:
 *
 * @Author wk
 * @Create 2023/08/7 0007 下午 02:32:05
 * @Version 1.0Z
 */
@Getter
@AllArgsConstructor
public class NodeUI {
    private String id;
    private String label;
    private long pendingTime;
    private JSONObject style;

    public NodeUI(String id) {
        this.id = id;
        this.label = id;
    }

    public NodeUI(String id, long pendingTime) {
        this.id = id;
        this.label = id;
        this.pendingTime = pendingTime;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public long getPendingTime() {
        return pendingTime;
    }

    public void setPendingTime(long pendingTime) {
        this.pendingTime = pendingTime;
    }

    public void buildHighLight() {
        if (this.style == null){
            this.style = new JSONObject();
        }
        this.style.set("fill", "#00FF00");
//        this.style.set("stroke", "00FF00");
    }

    public void buildRed() {
        if (this.style == null){
            this.style = new JSONObject();
        }
        this.style.set("lineWidth", 3);
        this.style.set("stroke", "FF0000");
    }

    public void buildPurple() {
        if (this.style == null){
            this.style = new JSONObject();
        }
        this.style.set("lineWidth", 3);
        this.style.set("stroke", "800080");
    }
}
